home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2 Examples.sit
/
Raven 1.2 Examples
/
Quill
/
Source
/
PicturePaneEditor.cpp
< prev
next >
Wrap
Text File
|
1997-09-08
|
4KB
|
136 lines
/*
* File: PicturePaneEditor.cpp
* Summary: A view that knows how to edit a TPicturePane.
* Written by: Jesse Jones
*
* Copyright ゥ 1997 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <1> 9/08/97 JDJ Created
*/
#include "PicturePaneEditor.h"
#include <ZControl.h>
#include <ZTextBox.h>
// ===================================================================================
// class CPicturePaneCommand
// ===================================================================================
//---------------------------------------------------------------
//
// CPicturePaneCommand::~CPicturePaneCommand
//
//---------------------------------------------------------------
CPicturePaneCommand::~CPicturePaneCommand()
{
}
//---------------------------------------------------------------
//
// CPicturePaneCommand::CPicturePaneCommand
//
//---------------------------------------------------------------
CPicturePaneCommand::CPicturePaneCommand(TPicturePane* pane, const SPicturePaneInfo& oldInfo, const SPicturePaneInfo& newInfo) : Inherited(pane, oldInfo, newInfo)
{
}
//---------------------------------------------------------------
//
// CPicturePaneCommand::UpdatePane
//
//---------------------------------------------------------------
void CPicturePaneCommand::UpdatePane(const SPicturePaneInfo& info)
{
mPane->SetPicture(info.id);
mPane->SetDrawFrame(info.drawFrame);
mPane->EnableScalingWarning(info.warnIfScaling);
}
#pragma mark -
// ===================================================================================
// CPicturePaneEditor
// ===================================================================================
static TReanimatorRegister<CPicturePaneEditor> sPicturePaneEditorRegistrar;
//---------------------------------------------------------------
//
// CPicturePaneEditor::~CPicturePaneEditor
//
//---------------------------------------------------------------
CPicturePaneEditor::~CPicturePaneEditor()
{
}
//---------------------------------------------------------------
//
// CPicturePaneEditor::CPicturePaneEditor
//
//---------------------------------------------------------------
CPicturePaneEditor::CPicturePaneEditor(TView* superView) : Inherited(superView)
{
}
//---------------------------------------------------------------
//
// CPicturePaneEditor::Create [static]
//
//---------------------------------------------------------------
MReanimatable* CPicturePaneEditor::Create(MReanimatable* parent)
{
return new CPicturePaneEditor(dynamic_cast<TView*>(parent));
}
//---------------------------------------------------------------
//
// CPicturePaneEditor::GetEditorInfo
//
//---------------------------------------------------------------
SPicturePaneInfo CPicturePaneEditor::GetEditorInfo() const
{
SPicturePaneInfo info;
TTextBox* color = dynamic_cast<TTextBox*>(this->FindSubPane("ID"));
info.id = color->GetValue();
TControl* control = dynamic_cast<TControl*>(this->FindSubPane("Draw Frame"));
info.drawFrame = control->GetValue();
control = dynamic_cast<TControl*>(this->FindSubPane("Warn"));
info.warnIfScaling = control->GetValue();
return info;
}
//---------------------------------------------------------------
//
// CPicturePaneEditor::SetEditorInfo
//
//---------------------------------------------------------------
void CPicturePaneEditor::SetEditorInfo(const SPicturePaneInfo& info)
{
TTextBox* color = dynamic_cast<TTextBox*>(this->FindSubPane("ID"));
color->SetValue(info.id);
TControl* control = dynamic_cast<TControl*>(this->FindSubPane("Draw Frame"));
control->SetValue(info.drawFrame);
control = dynamic_cast<TControl*>(this->FindSubPane("Warn"));
control->SetValue(info.warnIfScaling);
}